Left Termination of the query pattern log2_in_2(a, g) w.r.t. the given Prolog program could not be shown:



Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof

Clauses:

log2(X, Y) :- log2(X, 0, Y).
log2(0, I, I).
log2(s(0), I, I).
log2(s(s(X)), I, Y) :- ','(half(s(s(X)), X1), log2(X1, s(I), Y)).
half(0, 0).
half(s(0), 0).
half(s(s(X)), s(Y)) :- half(X, Y).

Queries:

log2(a,g).

We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
log2_in: (f,b)
log2_in: (f,b,b) (b,b,b)
half_in: (b,f) (f,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

log2_in_ag(X, Y) → U1_ag(X, Y, log2_in_agg(X, 0, Y))
log2_in_agg(0, I, I) → log2_out_agg(0, I, I)
log2_in_agg(s(0), I, I) → log2_out_agg(s(0), I, I)
log2_in_agg(s(s(X)), I, Y) → U2_agg(X, I, Y, half_in_ga(s(s(X)), X1))
half_in_ga(0, 0) → half_out_ga(0, 0)
half_in_ga(s(0), 0) → half_out_ga(s(0), 0)
half_in_ga(s(s(X)), s(Y)) → U4_ga(X, Y, half_in_aa(X, Y))
half_in_aa(0, 0) → half_out_aa(0, 0)
half_in_aa(s(0), 0) → half_out_aa(s(0), 0)
half_in_aa(s(s(X)), s(Y)) → U4_aa(X, Y, half_in_aa(X, Y))
U4_aa(X, Y, half_out_aa(X, Y)) → half_out_aa(s(s(X)), s(Y))
U4_ga(X, Y, half_out_aa(X, Y)) → half_out_ga(s(s(X)), s(Y))
U2_agg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_agg(X, I, Y, log2_in_ggg(X1, s(I), Y))
log2_in_ggg(0, I, I) → log2_out_ggg(0, I, I)
log2_in_ggg(s(0), I, I) → log2_out_ggg(s(0), I, I)
log2_in_ggg(s(s(X)), I, Y) → U2_ggg(X, I, Y, half_in_ga(s(s(X)), X1))
U2_ggg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_ggg(X, I, Y, log2_in_ggg(X1, s(I), Y))
U3_ggg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_ggg(s(s(X)), I, Y)
U3_agg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_agg(s(s(X)), I, Y)
U1_ag(X, Y, log2_out_agg(X, 0, Y)) → log2_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
log2_in_ag(x1, x2)  =  log2_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x3)
log2_in_agg(x1, x2, x3)  =  log2_in_agg(x2, x3)
log2_out_agg(x1, x2, x3)  =  log2_out_agg(x1)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x3, x4)
half_in_ga(x1, x2)  =  half_in_ga(x1)
s(x1)  =  s
0  =  0
half_out_ga(x1, x2)  =  half_out_ga(x2)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
half_in_aa(x1, x2)  =  half_in_aa
half_out_aa(x1, x2)  =  half_out_aa(x1, x2)
U4_aa(x1, x2, x3)  =  U4_aa(x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x4)
log2_in_ggg(x1, x2, x3)  =  log2_in_ggg(x1, x2, x3)
log2_out_ggg(x1, x2, x3)  =  log2_out_ggg
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x3, x4)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x4)
log2_out_ag(x1, x2)  =  log2_out_ag(x1)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof
  ↳ PrologToPiTRSProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

log2_in_ag(X, Y) → U1_ag(X, Y, log2_in_agg(X, 0, Y))
log2_in_agg(0, I, I) → log2_out_agg(0, I, I)
log2_in_agg(s(0), I, I) → log2_out_agg(s(0), I, I)
log2_in_agg(s(s(X)), I, Y) → U2_agg(X, I, Y, half_in_ga(s(s(X)), X1))
half_in_ga(0, 0) → half_out_ga(0, 0)
half_in_ga(s(0), 0) → half_out_ga(s(0), 0)
half_in_ga(s(s(X)), s(Y)) → U4_ga(X, Y, half_in_aa(X, Y))
half_in_aa(0, 0) → half_out_aa(0, 0)
half_in_aa(s(0), 0) → half_out_aa(s(0), 0)
half_in_aa(s(s(X)), s(Y)) → U4_aa(X, Y, half_in_aa(X, Y))
U4_aa(X, Y, half_out_aa(X, Y)) → half_out_aa(s(s(X)), s(Y))
U4_ga(X, Y, half_out_aa(X, Y)) → half_out_ga(s(s(X)), s(Y))
U2_agg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_agg(X, I, Y, log2_in_ggg(X1, s(I), Y))
log2_in_ggg(0, I, I) → log2_out_ggg(0, I, I)
log2_in_ggg(s(0), I, I) → log2_out_ggg(s(0), I, I)
log2_in_ggg(s(s(X)), I, Y) → U2_ggg(X, I, Y, half_in_ga(s(s(X)), X1))
U2_ggg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_ggg(X, I, Y, log2_in_ggg(X1, s(I), Y))
U3_ggg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_ggg(s(s(X)), I, Y)
U3_agg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_agg(s(s(X)), I, Y)
U1_ag(X, Y, log2_out_agg(X, 0, Y)) → log2_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
log2_in_ag(x1, x2)  =  log2_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x3)
log2_in_agg(x1, x2, x3)  =  log2_in_agg(x2, x3)
log2_out_agg(x1, x2, x3)  =  log2_out_agg(x1)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x3, x4)
half_in_ga(x1, x2)  =  half_in_ga(x1)
s(x1)  =  s
0  =  0
half_out_ga(x1, x2)  =  half_out_ga(x2)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
half_in_aa(x1, x2)  =  half_in_aa
half_out_aa(x1, x2)  =  half_out_aa(x1, x2)
U4_aa(x1, x2, x3)  =  U4_aa(x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x4)
log2_in_ggg(x1, x2, x3)  =  log2_in_ggg(x1, x2, x3)
log2_out_ggg(x1, x2, x3)  =  log2_out_ggg
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x3, x4)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x4)
log2_out_ag(x1, x2)  =  log2_out_ag(x1)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

LOG2_IN_AG(X, Y) → U1_AG(X, Y, log2_in_agg(X, 0, Y))
LOG2_IN_AG(X, Y) → LOG2_IN_AGG(X, 0, Y)
LOG2_IN_AGG(s(s(X)), I, Y) → U2_AGG(X, I, Y, half_in_ga(s(s(X)), X1))
LOG2_IN_AGG(s(s(X)), I, Y) → HALF_IN_GA(s(s(X)), X1)
HALF_IN_GA(s(s(X)), s(Y)) → U4_GA(X, Y, half_in_aa(X, Y))
HALF_IN_GA(s(s(X)), s(Y)) → HALF_IN_AA(X, Y)
HALF_IN_AA(s(s(X)), s(Y)) → U4_AA(X, Y, half_in_aa(X, Y))
HALF_IN_AA(s(s(X)), s(Y)) → HALF_IN_AA(X, Y)
U2_AGG(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_AGG(X, I, Y, log2_in_ggg(X1, s(I), Y))
U2_AGG(X, I, Y, half_out_ga(s(s(X)), X1)) → LOG2_IN_GGG(X1, s(I), Y)
LOG2_IN_GGG(s(s(X)), I, Y) → U2_GGG(X, I, Y, half_in_ga(s(s(X)), X1))
LOG2_IN_GGG(s(s(X)), I, Y) → HALF_IN_GA(s(s(X)), X1)
U2_GGG(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_GGG(X, I, Y, log2_in_ggg(X1, s(I), Y))
U2_GGG(X, I, Y, half_out_ga(s(s(X)), X1)) → LOG2_IN_GGG(X1, s(I), Y)

The TRS R consists of the following rules:

log2_in_ag(X, Y) → U1_ag(X, Y, log2_in_agg(X, 0, Y))
log2_in_agg(0, I, I) → log2_out_agg(0, I, I)
log2_in_agg(s(0), I, I) → log2_out_agg(s(0), I, I)
log2_in_agg(s(s(X)), I, Y) → U2_agg(X, I, Y, half_in_ga(s(s(X)), X1))
half_in_ga(0, 0) → half_out_ga(0, 0)
half_in_ga(s(0), 0) → half_out_ga(s(0), 0)
half_in_ga(s(s(X)), s(Y)) → U4_ga(X, Y, half_in_aa(X, Y))
half_in_aa(0, 0) → half_out_aa(0, 0)
half_in_aa(s(0), 0) → half_out_aa(s(0), 0)
half_in_aa(s(s(X)), s(Y)) → U4_aa(X, Y, half_in_aa(X, Y))
U4_aa(X, Y, half_out_aa(X, Y)) → half_out_aa(s(s(X)), s(Y))
U4_ga(X, Y, half_out_aa(X, Y)) → half_out_ga(s(s(X)), s(Y))
U2_agg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_agg(X, I, Y, log2_in_ggg(X1, s(I), Y))
log2_in_ggg(0, I, I) → log2_out_ggg(0, I, I)
log2_in_ggg(s(0), I, I) → log2_out_ggg(s(0), I, I)
log2_in_ggg(s(s(X)), I, Y) → U2_ggg(X, I, Y, half_in_ga(s(s(X)), X1))
U2_ggg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_ggg(X, I, Y, log2_in_ggg(X1, s(I), Y))
U3_ggg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_ggg(s(s(X)), I, Y)
U3_agg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_agg(s(s(X)), I, Y)
U1_ag(X, Y, log2_out_agg(X, 0, Y)) → log2_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
log2_in_ag(x1, x2)  =  log2_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x3)
log2_in_agg(x1, x2, x3)  =  log2_in_agg(x2, x3)
log2_out_agg(x1, x2, x3)  =  log2_out_agg(x1)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x3, x4)
half_in_ga(x1, x2)  =  half_in_ga(x1)
s(x1)  =  s
0  =  0
half_out_ga(x1, x2)  =  half_out_ga(x2)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
half_in_aa(x1, x2)  =  half_in_aa
half_out_aa(x1, x2)  =  half_out_aa(x1, x2)
U4_aa(x1, x2, x3)  =  U4_aa(x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x4)
log2_in_ggg(x1, x2, x3)  =  log2_in_ggg(x1, x2, x3)
log2_out_ggg(x1, x2, x3)  =  log2_out_ggg
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x3, x4)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x4)
log2_out_ag(x1, x2)  =  log2_out_ag(x1)
U3_AGG(x1, x2, x3, x4)  =  U3_AGG(x4)
LOG2_IN_AGG(x1, x2, x3)  =  LOG2_IN_AGG(x2, x3)
LOG2_IN_GGG(x1, x2, x3)  =  LOG2_IN_GGG(x1, x2, x3)
U3_GGG(x1, x2, x3, x4)  =  U3_GGG(x4)
HALF_IN_GA(x1, x2)  =  HALF_IN_GA(x1)
U2_AGG(x1, x2, x3, x4)  =  U2_AGG(x3, x4)
U2_GGG(x1, x2, x3, x4)  =  U2_GGG(x3, x4)
HALF_IN_AA(x1, x2)  =  HALF_IN_AA
U4_GA(x1, x2, x3)  =  U4_GA(x3)
U1_AG(x1, x2, x3)  =  U1_AG(x3)
U4_AA(x1, x2, x3)  =  U4_AA(x3)
LOG2_IN_AG(x1, x2)  =  LOG2_IN_AG(x2)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

LOG2_IN_AG(X, Y) → U1_AG(X, Y, log2_in_agg(X, 0, Y))
LOG2_IN_AG(X, Y) → LOG2_IN_AGG(X, 0, Y)
LOG2_IN_AGG(s(s(X)), I, Y) → U2_AGG(X, I, Y, half_in_ga(s(s(X)), X1))
LOG2_IN_AGG(s(s(X)), I, Y) → HALF_IN_GA(s(s(X)), X1)
HALF_IN_GA(s(s(X)), s(Y)) → U4_GA(X, Y, half_in_aa(X, Y))
HALF_IN_GA(s(s(X)), s(Y)) → HALF_IN_AA(X, Y)
HALF_IN_AA(s(s(X)), s(Y)) → U4_AA(X, Y, half_in_aa(X, Y))
HALF_IN_AA(s(s(X)), s(Y)) → HALF_IN_AA(X, Y)
U2_AGG(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_AGG(X, I, Y, log2_in_ggg(X1, s(I), Y))
U2_AGG(X, I, Y, half_out_ga(s(s(X)), X1)) → LOG2_IN_GGG(X1, s(I), Y)
LOG2_IN_GGG(s(s(X)), I, Y) → U2_GGG(X, I, Y, half_in_ga(s(s(X)), X1))
LOG2_IN_GGG(s(s(X)), I, Y) → HALF_IN_GA(s(s(X)), X1)
U2_GGG(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_GGG(X, I, Y, log2_in_ggg(X1, s(I), Y))
U2_GGG(X, I, Y, half_out_ga(s(s(X)), X1)) → LOG2_IN_GGG(X1, s(I), Y)

The TRS R consists of the following rules:

log2_in_ag(X, Y) → U1_ag(X, Y, log2_in_agg(X, 0, Y))
log2_in_agg(0, I, I) → log2_out_agg(0, I, I)
log2_in_agg(s(0), I, I) → log2_out_agg(s(0), I, I)
log2_in_agg(s(s(X)), I, Y) → U2_agg(X, I, Y, half_in_ga(s(s(X)), X1))
half_in_ga(0, 0) → half_out_ga(0, 0)
half_in_ga(s(0), 0) → half_out_ga(s(0), 0)
half_in_ga(s(s(X)), s(Y)) → U4_ga(X, Y, half_in_aa(X, Y))
half_in_aa(0, 0) → half_out_aa(0, 0)
half_in_aa(s(0), 0) → half_out_aa(s(0), 0)
half_in_aa(s(s(X)), s(Y)) → U4_aa(X, Y, half_in_aa(X, Y))
U4_aa(X, Y, half_out_aa(X, Y)) → half_out_aa(s(s(X)), s(Y))
U4_ga(X, Y, half_out_aa(X, Y)) → half_out_ga(s(s(X)), s(Y))
U2_agg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_agg(X, I, Y, log2_in_ggg(X1, s(I), Y))
log2_in_ggg(0, I, I) → log2_out_ggg(0, I, I)
log2_in_ggg(s(0), I, I) → log2_out_ggg(s(0), I, I)
log2_in_ggg(s(s(X)), I, Y) → U2_ggg(X, I, Y, half_in_ga(s(s(X)), X1))
U2_ggg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_ggg(X, I, Y, log2_in_ggg(X1, s(I), Y))
U3_ggg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_ggg(s(s(X)), I, Y)
U3_agg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_agg(s(s(X)), I, Y)
U1_ag(X, Y, log2_out_agg(X, 0, Y)) → log2_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
log2_in_ag(x1, x2)  =  log2_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x3)
log2_in_agg(x1, x2, x3)  =  log2_in_agg(x2, x3)
log2_out_agg(x1, x2, x3)  =  log2_out_agg(x1)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x3, x4)
half_in_ga(x1, x2)  =  half_in_ga(x1)
s(x1)  =  s
0  =  0
half_out_ga(x1, x2)  =  half_out_ga(x2)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
half_in_aa(x1, x2)  =  half_in_aa
half_out_aa(x1, x2)  =  half_out_aa(x1, x2)
U4_aa(x1, x2, x3)  =  U4_aa(x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x4)
log2_in_ggg(x1, x2, x3)  =  log2_in_ggg(x1, x2, x3)
log2_out_ggg(x1, x2, x3)  =  log2_out_ggg
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x3, x4)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x4)
log2_out_ag(x1, x2)  =  log2_out_ag(x1)
U3_AGG(x1, x2, x3, x4)  =  U3_AGG(x4)
LOG2_IN_AGG(x1, x2, x3)  =  LOG2_IN_AGG(x2, x3)
LOG2_IN_GGG(x1, x2, x3)  =  LOG2_IN_GGG(x1, x2, x3)
U3_GGG(x1, x2, x3, x4)  =  U3_GGG(x4)
HALF_IN_GA(x1, x2)  =  HALF_IN_GA(x1)
U2_AGG(x1, x2, x3, x4)  =  U2_AGG(x3, x4)
U2_GGG(x1, x2, x3, x4)  =  U2_GGG(x3, x4)
HALF_IN_AA(x1, x2)  =  HALF_IN_AA
U4_GA(x1, x2, x3)  =  U4_GA(x3)
U1_AG(x1, x2, x3)  =  U1_AG(x3)
U4_AA(x1, x2, x3)  =  U4_AA(x3)
LOG2_IN_AG(x1, x2)  =  LOG2_IN_AG(x2)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 11 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

HALF_IN_AA(s(s(X)), s(Y)) → HALF_IN_AA(X, Y)

The TRS R consists of the following rules:

log2_in_ag(X, Y) → U1_ag(X, Y, log2_in_agg(X, 0, Y))
log2_in_agg(0, I, I) → log2_out_agg(0, I, I)
log2_in_agg(s(0), I, I) → log2_out_agg(s(0), I, I)
log2_in_agg(s(s(X)), I, Y) → U2_agg(X, I, Y, half_in_ga(s(s(X)), X1))
half_in_ga(0, 0) → half_out_ga(0, 0)
half_in_ga(s(0), 0) → half_out_ga(s(0), 0)
half_in_ga(s(s(X)), s(Y)) → U4_ga(X, Y, half_in_aa(X, Y))
half_in_aa(0, 0) → half_out_aa(0, 0)
half_in_aa(s(0), 0) → half_out_aa(s(0), 0)
half_in_aa(s(s(X)), s(Y)) → U4_aa(X, Y, half_in_aa(X, Y))
U4_aa(X, Y, half_out_aa(X, Y)) → half_out_aa(s(s(X)), s(Y))
U4_ga(X, Y, half_out_aa(X, Y)) → half_out_ga(s(s(X)), s(Y))
U2_agg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_agg(X, I, Y, log2_in_ggg(X1, s(I), Y))
log2_in_ggg(0, I, I) → log2_out_ggg(0, I, I)
log2_in_ggg(s(0), I, I) → log2_out_ggg(s(0), I, I)
log2_in_ggg(s(s(X)), I, Y) → U2_ggg(X, I, Y, half_in_ga(s(s(X)), X1))
U2_ggg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_ggg(X, I, Y, log2_in_ggg(X1, s(I), Y))
U3_ggg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_ggg(s(s(X)), I, Y)
U3_agg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_agg(s(s(X)), I, Y)
U1_ag(X, Y, log2_out_agg(X, 0, Y)) → log2_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
log2_in_ag(x1, x2)  =  log2_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x3)
log2_in_agg(x1, x2, x3)  =  log2_in_agg(x2, x3)
log2_out_agg(x1, x2, x3)  =  log2_out_agg(x1)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x3, x4)
half_in_ga(x1, x2)  =  half_in_ga(x1)
s(x1)  =  s
0  =  0
half_out_ga(x1, x2)  =  half_out_ga(x2)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
half_in_aa(x1, x2)  =  half_in_aa
half_out_aa(x1, x2)  =  half_out_aa(x1, x2)
U4_aa(x1, x2, x3)  =  U4_aa(x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x4)
log2_in_ggg(x1, x2, x3)  =  log2_in_ggg(x1, x2, x3)
log2_out_ggg(x1, x2, x3)  =  log2_out_ggg
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x3, x4)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x4)
log2_out_ag(x1, x2)  =  log2_out_ag(x1)
HALF_IN_AA(x1, x2)  =  HALF_IN_AA

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

HALF_IN_AA(s(s(X)), s(Y)) → HALF_IN_AA(X, Y)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s
HALF_IN_AA(x1, x2)  =  HALF_IN_AA

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ NonTerminationProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

HALF_IN_AAHALF_IN_AA

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

HALF_IN_AAHALF_IN_AA

The TRS R consists of the following rules:none


s = HALF_IN_AA evaluates to t =HALF_IN_AA

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from HALF_IN_AA to HALF_IN_AA.





↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

LOG2_IN_GGG(s(s(X)), I, Y) → U2_GGG(X, I, Y, half_in_ga(s(s(X)), X1))
U2_GGG(X, I, Y, half_out_ga(s(s(X)), X1)) → LOG2_IN_GGG(X1, s(I), Y)

The TRS R consists of the following rules:

log2_in_ag(X, Y) → U1_ag(X, Y, log2_in_agg(X, 0, Y))
log2_in_agg(0, I, I) → log2_out_agg(0, I, I)
log2_in_agg(s(0), I, I) → log2_out_agg(s(0), I, I)
log2_in_agg(s(s(X)), I, Y) → U2_agg(X, I, Y, half_in_ga(s(s(X)), X1))
half_in_ga(0, 0) → half_out_ga(0, 0)
half_in_ga(s(0), 0) → half_out_ga(s(0), 0)
half_in_ga(s(s(X)), s(Y)) → U4_ga(X, Y, half_in_aa(X, Y))
half_in_aa(0, 0) → half_out_aa(0, 0)
half_in_aa(s(0), 0) → half_out_aa(s(0), 0)
half_in_aa(s(s(X)), s(Y)) → U4_aa(X, Y, half_in_aa(X, Y))
U4_aa(X, Y, half_out_aa(X, Y)) → half_out_aa(s(s(X)), s(Y))
U4_ga(X, Y, half_out_aa(X, Y)) → half_out_ga(s(s(X)), s(Y))
U2_agg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_agg(X, I, Y, log2_in_ggg(X1, s(I), Y))
log2_in_ggg(0, I, I) → log2_out_ggg(0, I, I)
log2_in_ggg(s(0), I, I) → log2_out_ggg(s(0), I, I)
log2_in_ggg(s(s(X)), I, Y) → U2_ggg(X, I, Y, half_in_ga(s(s(X)), X1))
U2_ggg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_ggg(X, I, Y, log2_in_ggg(X1, s(I), Y))
U3_ggg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_ggg(s(s(X)), I, Y)
U3_agg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_agg(s(s(X)), I, Y)
U1_ag(X, Y, log2_out_agg(X, 0, Y)) → log2_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
log2_in_ag(x1, x2)  =  log2_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x3)
log2_in_agg(x1, x2, x3)  =  log2_in_agg(x2, x3)
log2_out_agg(x1, x2, x3)  =  log2_out_agg(x1)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x3, x4)
half_in_ga(x1, x2)  =  half_in_ga(x1)
s(x1)  =  s
0  =  0
half_out_ga(x1, x2)  =  half_out_ga(x2)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
half_in_aa(x1, x2)  =  half_in_aa
half_out_aa(x1, x2)  =  half_out_aa(x1, x2)
U4_aa(x1, x2, x3)  =  U4_aa(x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x4)
log2_in_ggg(x1, x2, x3)  =  log2_in_ggg(x1, x2, x3)
log2_out_ggg(x1, x2, x3)  =  log2_out_ggg
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x3, x4)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x4)
log2_out_ag(x1, x2)  =  log2_out_ag(x1)
LOG2_IN_GGG(x1, x2, x3)  =  LOG2_IN_GGG(x1, x2, x3)
U2_GGG(x1, x2, x3, x4)  =  U2_GGG(x3, x4)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

LOG2_IN_GGG(s(s(X)), I, Y) → U2_GGG(X, I, Y, half_in_ga(s(s(X)), X1))
U2_GGG(X, I, Y, half_out_ga(s(s(X)), X1)) → LOG2_IN_GGG(X1, s(I), Y)

The TRS R consists of the following rules:

half_in_ga(s(s(X)), s(Y)) → U4_ga(X, Y, half_in_aa(X, Y))
U4_ga(X, Y, half_out_aa(X, Y)) → half_out_ga(s(s(X)), s(Y))
half_in_aa(0, 0) → half_out_aa(0, 0)
half_in_aa(s(0), 0) → half_out_aa(s(0), 0)
half_in_aa(s(s(X)), s(Y)) → U4_aa(X, Y, half_in_aa(X, Y))
U4_aa(X, Y, half_out_aa(X, Y)) → half_out_aa(s(s(X)), s(Y))

The argument filtering Pi contains the following mapping:
half_in_ga(x1, x2)  =  half_in_ga(x1)
s(x1)  =  s
0  =  0
half_out_ga(x1, x2)  =  half_out_ga(x2)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
half_in_aa(x1, x2)  =  half_in_aa
half_out_aa(x1, x2)  =  half_out_aa(x1, x2)
U4_aa(x1, x2, x3)  =  U4_aa(x3)
LOG2_IN_GGG(x1, x2, x3)  =  LOG2_IN_GGG(x1, x2, x3)
U2_GGG(x1, x2, x3, x4)  =  U2_GGG(x3, x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Instantiation
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U2_GGG(Y, half_out_ga(X1)) → LOG2_IN_GGG(X1, s, Y)
LOG2_IN_GGG(s, I, Y) → U2_GGG(Y, half_in_ga(s))

The TRS R consists of the following rules:

half_in_ga(s) → U4_ga(half_in_aa)
U4_ga(half_out_aa(X, Y)) → half_out_ga(s)
half_in_aahalf_out_aa(0, 0)
half_in_aahalf_out_aa(s, 0)
half_in_aaU4_aa(half_in_aa)
U4_aa(half_out_aa(X, Y)) → half_out_aa(s, s)

The set Q consists of the following terms:

half_in_ga(x0)
U4_ga(x0)
half_in_aa
U4_aa(x0)

We have to consider all (P,Q,R)-chains.
By instantiating [15] the rule LOG2_IN_GGG(s, I, Y) → U2_GGG(Y, half_in_ga(s)) we obtained the following new rules:

LOG2_IN_GGG(s, s, z0) → U2_GGG(z0, half_in_ga(s))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
QDP
                            ↳ Narrowing
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

LOG2_IN_GGG(s, s, z0) → U2_GGG(z0, half_in_ga(s))
U2_GGG(Y, half_out_ga(X1)) → LOG2_IN_GGG(X1, s, Y)

The TRS R consists of the following rules:

half_in_ga(s) → U4_ga(half_in_aa)
U4_ga(half_out_aa(X, Y)) → half_out_ga(s)
half_in_aahalf_out_aa(0, 0)
half_in_aahalf_out_aa(s, 0)
half_in_aaU4_aa(half_in_aa)
U4_aa(half_out_aa(X, Y)) → half_out_aa(s, s)

The set Q consists of the following terms:

half_in_ga(x0)
U4_ga(x0)
half_in_aa
U4_aa(x0)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule LOG2_IN_GGG(s, s, z0) → U2_GGG(z0, half_in_ga(s)) at position [1] we obtained the following new rules:

LOG2_IN_GGG(s, s, y0) → U2_GGG(y0, U4_ga(half_in_aa))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
                          ↳ QDP
                            ↳ Narrowing
QDP
                                ↳ UsableRulesProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

LOG2_IN_GGG(s, s, y0) → U2_GGG(y0, U4_ga(half_in_aa))
U2_GGG(Y, half_out_ga(X1)) → LOG2_IN_GGG(X1, s, Y)

The TRS R consists of the following rules:

half_in_ga(s) → U4_ga(half_in_aa)
U4_ga(half_out_aa(X, Y)) → half_out_ga(s)
half_in_aahalf_out_aa(0, 0)
half_in_aahalf_out_aa(s, 0)
half_in_aaU4_aa(half_in_aa)
U4_aa(half_out_aa(X, Y)) → half_out_aa(s, s)

The set Q consists of the following terms:

half_in_ga(x0)
U4_ga(x0)
half_in_aa
U4_aa(x0)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
                          ↳ QDP
                            ↳ Narrowing
                              ↳ QDP
                                ↳ UsableRulesProof
QDP
                                    ↳ QReductionProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

LOG2_IN_GGG(s, s, y0) → U2_GGG(y0, U4_ga(half_in_aa))
U2_GGG(Y, half_out_ga(X1)) → LOG2_IN_GGG(X1, s, Y)

The TRS R consists of the following rules:

half_in_aahalf_out_aa(0, 0)
half_in_aahalf_out_aa(s, 0)
half_in_aaU4_aa(half_in_aa)
U4_ga(half_out_aa(X, Y)) → half_out_ga(s)
U4_aa(half_out_aa(X, Y)) → half_out_aa(s, s)

The set Q consists of the following terms:

half_in_ga(x0)
U4_ga(x0)
half_in_aa
U4_aa(x0)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

half_in_ga(x0)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
                          ↳ QDP
                            ↳ Narrowing
                              ↳ QDP
                                ↳ UsableRulesProof
                                  ↳ QDP
                                    ↳ QReductionProof
QDP
                                        ↳ ForwardInstantiation
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

LOG2_IN_GGG(s, s, y0) → U2_GGG(y0, U4_ga(half_in_aa))
U2_GGG(Y, half_out_ga(X1)) → LOG2_IN_GGG(X1, s, Y)

The TRS R consists of the following rules:

half_in_aahalf_out_aa(0, 0)
half_in_aahalf_out_aa(s, 0)
half_in_aaU4_aa(half_in_aa)
U4_ga(half_out_aa(X, Y)) → half_out_ga(s)
U4_aa(half_out_aa(X, Y)) → half_out_aa(s, s)

The set Q consists of the following terms:

U4_ga(x0)
half_in_aa
U4_aa(x0)

We have to consider all (P,Q,R)-chains.
By forward instantiating [14] the rule U2_GGG(Y, half_out_ga(X1)) → LOG2_IN_GGG(X1, s, Y) we obtained the following new rules:

U2_GGG(x0, half_out_ga(s)) → LOG2_IN_GGG(s, s, x0)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
                          ↳ QDP
                            ↳ Narrowing
                              ↳ QDP
                                ↳ UsableRulesProof
                                  ↳ QDP
                                    ↳ QReductionProof
                                      ↳ QDP
                                        ↳ ForwardInstantiation
QDP
                                            ↳ NonTerminationProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U2_GGG(x0, half_out_ga(s)) → LOG2_IN_GGG(s, s, x0)
LOG2_IN_GGG(s, s, y0) → U2_GGG(y0, U4_ga(half_in_aa))

The TRS R consists of the following rules:

half_in_aahalf_out_aa(0, 0)
half_in_aahalf_out_aa(s, 0)
half_in_aaU4_aa(half_in_aa)
U4_ga(half_out_aa(X, Y)) → half_out_ga(s)
U4_aa(half_out_aa(X, Y)) → half_out_aa(s, s)

The set Q consists of the following terms:

U4_ga(x0)
half_in_aa
U4_aa(x0)

We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

The TRS P consists of the following rules:

U2_GGG(x0, half_out_ga(s)) → LOG2_IN_GGG(s, s, x0)
LOG2_IN_GGG(s, s, y0) → U2_GGG(y0, U4_ga(half_in_aa))

The TRS R consists of the following rules:

half_in_aahalf_out_aa(0, 0)
half_in_aahalf_out_aa(s, 0)
half_in_aaU4_aa(half_in_aa)
U4_ga(half_out_aa(X, Y)) → half_out_ga(s)
U4_aa(half_out_aa(X, Y)) → half_out_aa(s, s)


s = U2_GGG(x0, U4_ga(half_in_aa)) evaluates to t =U2_GGG(x0, U4_ga(half_in_aa))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

U2_GGG(x0, U4_ga(half_in_aa))U2_GGG(x0, U4_ga(half_out_aa(0, 0)))
with rule half_in_aahalf_out_aa(0, 0) at position [1,0] and matcher [ ]

U2_GGG(x0, U4_ga(half_out_aa(0, 0)))U2_GGG(x0, half_out_ga(s))
with rule U4_ga(half_out_aa(X, Y)) → half_out_ga(s) at position [1] and matcher [X / 0, Y / 0]

U2_GGG(x0, half_out_ga(s))LOG2_IN_GGG(s, s, x0)
with rule U2_GGG(x0', half_out_ga(s)) → LOG2_IN_GGG(s, s, x0') at position [] and matcher [x0' / x0]

LOG2_IN_GGG(s, s, x0)U2_GGG(x0, U4_ga(half_in_aa))
with rule LOG2_IN_GGG(s, s, y0) → U2_GGG(y0, U4_ga(half_in_aa))

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.




We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
log2_in: (f,b)
log2_in: (f,b,b) (b,b,b)
half_in: (b,f) (f,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

log2_in_ag(X, Y) → U1_ag(X, Y, log2_in_agg(X, 0, Y))
log2_in_agg(0, I, I) → log2_out_agg(0, I, I)
log2_in_agg(s(0), I, I) → log2_out_agg(s(0), I, I)
log2_in_agg(s(s(X)), I, Y) → U2_agg(X, I, Y, half_in_ga(s(s(X)), X1))
half_in_ga(0, 0) → half_out_ga(0, 0)
half_in_ga(s(0), 0) → half_out_ga(s(0), 0)
half_in_ga(s(s(X)), s(Y)) → U4_ga(X, Y, half_in_aa(X, Y))
half_in_aa(0, 0) → half_out_aa(0, 0)
half_in_aa(s(0), 0) → half_out_aa(s(0), 0)
half_in_aa(s(s(X)), s(Y)) → U4_aa(X, Y, half_in_aa(X, Y))
U4_aa(X, Y, half_out_aa(X, Y)) → half_out_aa(s(s(X)), s(Y))
U4_ga(X, Y, half_out_aa(X, Y)) → half_out_ga(s(s(X)), s(Y))
U2_agg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_agg(X, I, Y, log2_in_ggg(X1, s(I), Y))
log2_in_ggg(0, I, I) → log2_out_ggg(0, I, I)
log2_in_ggg(s(0), I, I) → log2_out_ggg(s(0), I, I)
log2_in_ggg(s(s(X)), I, Y) → U2_ggg(X, I, Y, half_in_ga(s(s(X)), X1))
U2_ggg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_ggg(X, I, Y, log2_in_ggg(X1, s(I), Y))
U3_ggg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_ggg(s(s(X)), I, Y)
U3_agg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_agg(s(s(X)), I, Y)
U1_ag(X, Y, log2_out_agg(X, 0, Y)) → log2_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
log2_in_ag(x1, x2)  =  log2_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
log2_in_agg(x1, x2, x3)  =  log2_in_agg(x2, x3)
log2_out_agg(x1, x2, x3)  =  log2_out_agg(x1, x2, x3)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x2, x3, x4)
half_in_ga(x1, x2)  =  half_in_ga(x1)
s(x1)  =  s
0  =  0
half_out_ga(x1, x2)  =  half_out_ga(x1, x2)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
half_in_aa(x1, x2)  =  half_in_aa
half_out_aa(x1, x2)  =  half_out_aa(x1, x2)
U4_aa(x1, x2, x3)  =  U4_aa(x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x2, x3, x4)
log2_in_ggg(x1, x2, x3)  =  log2_in_ggg(x1, x2, x3)
log2_out_ggg(x1, x2, x3)  =  log2_out_ggg(x1, x2, x3)
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x2, x3, x4)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x2, x3, x4)
log2_out_ag(x1, x2)  =  log2_out_ag(x1, x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

log2_in_ag(X, Y) → U1_ag(X, Y, log2_in_agg(X, 0, Y))
log2_in_agg(0, I, I) → log2_out_agg(0, I, I)
log2_in_agg(s(0), I, I) → log2_out_agg(s(0), I, I)
log2_in_agg(s(s(X)), I, Y) → U2_agg(X, I, Y, half_in_ga(s(s(X)), X1))
half_in_ga(0, 0) → half_out_ga(0, 0)
half_in_ga(s(0), 0) → half_out_ga(s(0), 0)
half_in_ga(s(s(X)), s(Y)) → U4_ga(X, Y, half_in_aa(X, Y))
half_in_aa(0, 0) → half_out_aa(0, 0)
half_in_aa(s(0), 0) → half_out_aa(s(0), 0)
half_in_aa(s(s(X)), s(Y)) → U4_aa(X, Y, half_in_aa(X, Y))
U4_aa(X, Y, half_out_aa(X, Y)) → half_out_aa(s(s(X)), s(Y))
U4_ga(X, Y, half_out_aa(X, Y)) → half_out_ga(s(s(X)), s(Y))
U2_agg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_agg(X, I, Y, log2_in_ggg(X1, s(I), Y))
log2_in_ggg(0, I, I) → log2_out_ggg(0, I, I)
log2_in_ggg(s(0), I, I) → log2_out_ggg(s(0), I, I)
log2_in_ggg(s(s(X)), I, Y) → U2_ggg(X, I, Y, half_in_ga(s(s(X)), X1))
U2_ggg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_ggg(X, I, Y, log2_in_ggg(X1, s(I), Y))
U3_ggg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_ggg(s(s(X)), I, Y)
U3_agg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_agg(s(s(X)), I, Y)
U1_ag(X, Y, log2_out_agg(X, 0, Y)) → log2_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
log2_in_ag(x1, x2)  =  log2_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
log2_in_agg(x1, x2, x3)  =  log2_in_agg(x2, x3)
log2_out_agg(x1, x2, x3)  =  log2_out_agg(x1, x2, x3)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x2, x3, x4)
half_in_ga(x1, x2)  =  half_in_ga(x1)
s(x1)  =  s
0  =  0
half_out_ga(x1, x2)  =  half_out_ga(x1, x2)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
half_in_aa(x1, x2)  =  half_in_aa
half_out_aa(x1, x2)  =  half_out_aa(x1, x2)
U4_aa(x1, x2, x3)  =  U4_aa(x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x2, x3, x4)
log2_in_ggg(x1, x2, x3)  =  log2_in_ggg(x1, x2, x3)
log2_out_ggg(x1, x2, x3)  =  log2_out_ggg(x1, x2, x3)
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x2, x3, x4)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x2, x3, x4)
log2_out_ag(x1, x2)  =  log2_out_ag(x1, x2)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

LOG2_IN_AG(X, Y) → U1_AG(X, Y, log2_in_agg(X, 0, Y))
LOG2_IN_AG(X, Y) → LOG2_IN_AGG(X, 0, Y)
LOG2_IN_AGG(s(s(X)), I, Y) → U2_AGG(X, I, Y, half_in_ga(s(s(X)), X1))
LOG2_IN_AGG(s(s(X)), I, Y) → HALF_IN_GA(s(s(X)), X1)
HALF_IN_GA(s(s(X)), s(Y)) → U4_GA(X, Y, half_in_aa(X, Y))
HALF_IN_GA(s(s(X)), s(Y)) → HALF_IN_AA(X, Y)
HALF_IN_AA(s(s(X)), s(Y)) → U4_AA(X, Y, half_in_aa(X, Y))
HALF_IN_AA(s(s(X)), s(Y)) → HALF_IN_AA(X, Y)
U2_AGG(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_AGG(X, I, Y, log2_in_ggg(X1, s(I), Y))
U2_AGG(X, I, Y, half_out_ga(s(s(X)), X1)) → LOG2_IN_GGG(X1, s(I), Y)
LOG2_IN_GGG(s(s(X)), I, Y) → U2_GGG(X, I, Y, half_in_ga(s(s(X)), X1))
LOG2_IN_GGG(s(s(X)), I, Y) → HALF_IN_GA(s(s(X)), X1)
U2_GGG(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_GGG(X, I, Y, log2_in_ggg(X1, s(I), Y))
U2_GGG(X, I, Y, half_out_ga(s(s(X)), X1)) → LOG2_IN_GGG(X1, s(I), Y)

The TRS R consists of the following rules:

log2_in_ag(X, Y) → U1_ag(X, Y, log2_in_agg(X, 0, Y))
log2_in_agg(0, I, I) → log2_out_agg(0, I, I)
log2_in_agg(s(0), I, I) → log2_out_agg(s(0), I, I)
log2_in_agg(s(s(X)), I, Y) → U2_agg(X, I, Y, half_in_ga(s(s(X)), X1))
half_in_ga(0, 0) → half_out_ga(0, 0)
half_in_ga(s(0), 0) → half_out_ga(s(0), 0)
half_in_ga(s(s(X)), s(Y)) → U4_ga(X, Y, half_in_aa(X, Y))
half_in_aa(0, 0) → half_out_aa(0, 0)
half_in_aa(s(0), 0) → half_out_aa(s(0), 0)
half_in_aa(s(s(X)), s(Y)) → U4_aa(X, Y, half_in_aa(X, Y))
U4_aa(X, Y, half_out_aa(X, Y)) → half_out_aa(s(s(X)), s(Y))
U4_ga(X, Y, half_out_aa(X, Y)) → half_out_ga(s(s(X)), s(Y))
U2_agg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_agg(X, I, Y, log2_in_ggg(X1, s(I), Y))
log2_in_ggg(0, I, I) → log2_out_ggg(0, I, I)
log2_in_ggg(s(0), I, I) → log2_out_ggg(s(0), I, I)
log2_in_ggg(s(s(X)), I, Y) → U2_ggg(X, I, Y, half_in_ga(s(s(X)), X1))
U2_ggg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_ggg(X, I, Y, log2_in_ggg(X1, s(I), Y))
U3_ggg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_ggg(s(s(X)), I, Y)
U3_agg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_agg(s(s(X)), I, Y)
U1_ag(X, Y, log2_out_agg(X, 0, Y)) → log2_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
log2_in_ag(x1, x2)  =  log2_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
log2_in_agg(x1, x2, x3)  =  log2_in_agg(x2, x3)
log2_out_agg(x1, x2, x3)  =  log2_out_agg(x1, x2, x3)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x2, x3, x4)
half_in_ga(x1, x2)  =  half_in_ga(x1)
s(x1)  =  s
0  =  0
half_out_ga(x1, x2)  =  half_out_ga(x1, x2)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
half_in_aa(x1, x2)  =  half_in_aa
half_out_aa(x1, x2)  =  half_out_aa(x1, x2)
U4_aa(x1, x2, x3)  =  U4_aa(x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x2, x3, x4)
log2_in_ggg(x1, x2, x3)  =  log2_in_ggg(x1, x2, x3)
log2_out_ggg(x1, x2, x3)  =  log2_out_ggg(x1, x2, x3)
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x2, x3, x4)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x2, x3, x4)
log2_out_ag(x1, x2)  =  log2_out_ag(x1, x2)
U3_AGG(x1, x2, x3, x4)  =  U3_AGG(x2, x3, x4)
LOG2_IN_AGG(x1, x2, x3)  =  LOG2_IN_AGG(x2, x3)
LOG2_IN_GGG(x1, x2, x3)  =  LOG2_IN_GGG(x1, x2, x3)
U3_GGG(x1, x2, x3, x4)  =  U3_GGG(x2, x3, x4)
HALF_IN_GA(x1, x2)  =  HALF_IN_GA(x1)
U2_AGG(x1, x2, x3, x4)  =  U2_AGG(x2, x3, x4)
U2_GGG(x1, x2, x3, x4)  =  U2_GGG(x2, x3, x4)
HALF_IN_AA(x1, x2)  =  HALF_IN_AA
U4_GA(x1, x2, x3)  =  U4_GA(x3)
U1_AG(x1, x2, x3)  =  U1_AG(x2, x3)
U4_AA(x1, x2, x3)  =  U4_AA(x3)
LOG2_IN_AG(x1, x2)  =  LOG2_IN_AG(x2)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

LOG2_IN_AG(X, Y) → U1_AG(X, Y, log2_in_agg(X, 0, Y))
LOG2_IN_AG(X, Y) → LOG2_IN_AGG(X, 0, Y)
LOG2_IN_AGG(s(s(X)), I, Y) → U2_AGG(X, I, Y, half_in_ga(s(s(X)), X1))
LOG2_IN_AGG(s(s(X)), I, Y) → HALF_IN_GA(s(s(X)), X1)
HALF_IN_GA(s(s(X)), s(Y)) → U4_GA(X, Y, half_in_aa(X, Y))
HALF_IN_GA(s(s(X)), s(Y)) → HALF_IN_AA(X, Y)
HALF_IN_AA(s(s(X)), s(Y)) → U4_AA(X, Y, half_in_aa(X, Y))
HALF_IN_AA(s(s(X)), s(Y)) → HALF_IN_AA(X, Y)
U2_AGG(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_AGG(X, I, Y, log2_in_ggg(X1, s(I), Y))
U2_AGG(X, I, Y, half_out_ga(s(s(X)), X1)) → LOG2_IN_GGG(X1, s(I), Y)
LOG2_IN_GGG(s(s(X)), I, Y) → U2_GGG(X, I, Y, half_in_ga(s(s(X)), X1))
LOG2_IN_GGG(s(s(X)), I, Y) → HALF_IN_GA(s(s(X)), X1)
U2_GGG(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_GGG(X, I, Y, log2_in_ggg(X1, s(I), Y))
U2_GGG(X, I, Y, half_out_ga(s(s(X)), X1)) → LOG2_IN_GGG(X1, s(I), Y)

The TRS R consists of the following rules:

log2_in_ag(X, Y) → U1_ag(X, Y, log2_in_agg(X, 0, Y))
log2_in_agg(0, I, I) → log2_out_agg(0, I, I)
log2_in_agg(s(0), I, I) → log2_out_agg(s(0), I, I)
log2_in_agg(s(s(X)), I, Y) → U2_agg(X, I, Y, half_in_ga(s(s(X)), X1))
half_in_ga(0, 0) → half_out_ga(0, 0)
half_in_ga(s(0), 0) → half_out_ga(s(0), 0)
half_in_ga(s(s(X)), s(Y)) → U4_ga(X, Y, half_in_aa(X, Y))
half_in_aa(0, 0) → half_out_aa(0, 0)
half_in_aa(s(0), 0) → half_out_aa(s(0), 0)
half_in_aa(s(s(X)), s(Y)) → U4_aa(X, Y, half_in_aa(X, Y))
U4_aa(X, Y, half_out_aa(X, Y)) → half_out_aa(s(s(X)), s(Y))
U4_ga(X, Y, half_out_aa(X, Y)) → half_out_ga(s(s(X)), s(Y))
U2_agg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_agg(X, I, Y, log2_in_ggg(X1, s(I), Y))
log2_in_ggg(0, I, I) → log2_out_ggg(0, I, I)
log2_in_ggg(s(0), I, I) → log2_out_ggg(s(0), I, I)
log2_in_ggg(s(s(X)), I, Y) → U2_ggg(X, I, Y, half_in_ga(s(s(X)), X1))
U2_ggg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_ggg(X, I, Y, log2_in_ggg(X1, s(I), Y))
U3_ggg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_ggg(s(s(X)), I, Y)
U3_agg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_agg(s(s(X)), I, Y)
U1_ag(X, Y, log2_out_agg(X, 0, Y)) → log2_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
log2_in_ag(x1, x2)  =  log2_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
log2_in_agg(x1, x2, x3)  =  log2_in_agg(x2, x3)
log2_out_agg(x1, x2, x3)  =  log2_out_agg(x1, x2, x3)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x2, x3, x4)
half_in_ga(x1, x2)  =  half_in_ga(x1)
s(x1)  =  s
0  =  0
half_out_ga(x1, x2)  =  half_out_ga(x1, x2)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
half_in_aa(x1, x2)  =  half_in_aa
half_out_aa(x1, x2)  =  half_out_aa(x1, x2)
U4_aa(x1, x2, x3)  =  U4_aa(x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x2, x3, x4)
log2_in_ggg(x1, x2, x3)  =  log2_in_ggg(x1, x2, x3)
log2_out_ggg(x1, x2, x3)  =  log2_out_ggg(x1, x2, x3)
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x2, x3, x4)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x2, x3, x4)
log2_out_ag(x1, x2)  =  log2_out_ag(x1, x2)
U3_AGG(x1, x2, x3, x4)  =  U3_AGG(x2, x3, x4)
LOG2_IN_AGG(x1, x2, x3)  =  LOG2_IN_AGG(x2, x3)
LOG2_IN_GGG(x1, x2, x3)  =  LOG2_IN_GGG(x1, x2, x3)
U3_GGG(x1, x2, x3, x4)  =  U3_GGG(x2, x3, x4)
HALF_IN_GA(x1, x2)  =  HALF_IN_GA(x1)
U2_AGG(x1, x2, x3, x4)  =  U2_AGG(x2, x3, x4)
U2_GGG(x1, x2, x3, x4)  =  U2_GGG(x2, x3, x4)
HALF_IN_AA(x1, x2)  =  HALF_IN_AA
U4_GA(x1, x2, x3)  =  U4_GA(x3)
U1_AG(x1, x2, x3)  =  U1_AG(x2, x3)
U4_AA(x1, x2, x3)  =  U4_AA(x3)
LOG2_IN_AG(x1, x2)  =  LOG2_IN_AG(x2)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 2 SCCs with 11 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

HALF_IN_AA(s(s(X)), s(Y)) → HALF_IN_AA(X, Y)

The TRS R consists of the following rules:

log2_in_ag(X, Y) → U1_ag(X, Y, log2_in_agg(X, 0, Y))
log2_in_agg(0, I, I) → log2_out_agg(0, I, I)
log2_in_agg(s(0), I, I) → log2_out_agg(s(0), I, I)
log2_in_agg(s(s(X)), I, Y) → U2_agg(X, I, Y, half_in_ga(s(s(X)), X1))
half_in_ga(0, 0) → half_out_ga(0, 0)
half_in_ga(s(0), 0) → half_out_ga(s(0), 0)
half_in_ga(s(s(X)), s(Y)) → U4_ga(X, Y, half_in_aa(X, Y))
half_in_aa(0, 0) → half_out_aa(0, 0)
half_in_aa(s(0), 0) → half_out_aa(s(0), 0)
half_in_aa(s(s(X)), s(Y)) → U4_aa(X, Y, half_in_aa(X, Y))
U4_aa(X, Y, half_out_aa(X, Y)) → half_out_aa(s(s(X)), s(Y))
U4_ga(X, Y, half_out_aa(X, Y)) → half_out_ga(s(s(X)), s(Y))
U2_agg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_agg(X, I, Y, log2_in_ggg(X1, s(I), Y))
log2_in_ggg(0, I, I) → log2_out_ggg(0, I, I)
log2_in_ggg(s(0), I, I) → log2_out_ggg(s(0), I, I)
log2_in_ggg(s(s(X)), I, Y) → U2_ggg(X, I, Y, half_in_ga(s(s(X)), X1))
U2_ggg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_ggg(X, I, Y, log2_in_ggg(X1, s(I), Y))
U3_ggg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_ggg(s(s(X)), I, Y)
U3_agg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_agg(s(s(X)), I, Y)
U1_ag(X, Y, log2_out_agg(X, 0, Y)) → log2_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
log2_in_ag(x1, x2)  =  log2_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
log2_in_agg(x1, x2, x3)  =  log2_in_agg(x2, x3)
log2_out_agg(x1, x2, x3)  =  log2_out_agg(x1, x2, x3)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x2, x3, x4)
half_in_ga(x1, x2)  =  half_in_ga(x1)
s(x1)  =  s
0  =  0
half_out_ga(x1, x2)  =  half_out_ga(x1, x2)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
half_in_aa(x1, x2)  =  half_in_aa
half_out_aa(x1, x2)  =  half_out_aa(x1, x2)
U4_aa(x1, x2, x3)  =  U4_aa(x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x2, x3, x4)
log2_in_ggg(x1, x2, x3)  =  log2_in_ggg(x1, x2, x3)
log2_out_ggg(x1, x2, x3)  =  log2_out_ggg(x1, x2, x3)
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x2, x3, x4)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x2, x3, x4)
log2_out_ag(x1, x2)  =  log2_out_ag(x1, x2)
HALF_IN_AA(x1, x2)  =  HALF_IN_AA

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

HALF_IN_AA(s(s(X)), s(Y)) → HALF_IN_AA(X, Y)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s
HALF_IN_AA(x1, x2)  =  HALF_IN_AA

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ NonTerminationProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

HALF_IN_AAHALF_IN_AA

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.

The TRS P consists of the following rules:

HALF_IN_AAHALF_IN_AA

The TRS R consists of the following rules:none


s = HALF_IN_AA evaluates to t =HALF_IN_AA

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

The DP semiunifies directly so there is only one rewrite step from HALF_IN_AA to HALF_IN_AA.





↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof

Pi DP problem:
The TRS P consists of the following rules:

LOG2_IN_GGG(s(s(X)), I, Y) → U2_GGG(X, I, Y, half_in_ga(s(s(X)), X1))
U2_GGG(X, I, Y, half_out_ga(s(s(X)), X1)) → LOG2_IN_GGG(X1, s(I), Y)

The TRS R consists of the following rules:

log2_in_ag(X, Y) → U1_ag(X, Y, log2_in_agg(X, 0, Y))
log2_in_agg(0, I, I) → log2_out_agg(0, I, I)
log2_in_agg(s(0), I, I) → log2_out_agg(s(0), I, I)
log2_in_agg(s(s(X)), I, Y) → U2_agg(X, I, Y, half_in_ga(s(s(X)), X1))
half_in_ga(0, 0) → half_out_ga(0, 0)
half_in_ga(s(0), 0) → half_out_ga(s(0), 0)
half_in_ga(s(s(X)), s(Y)) → U4_ga(X, Y, half_in_aa(X, Y))
half_in_aa(0, 0) → half_out_aa(0, 0)
half_in_aa(s(0), 0) → half_out_aa(s(0), 0)
half_in_aa(s(s(X)), s(Y)) → U4_aa(X, Y, half_in_aa(X, Y))
U4_aa(X, Y, half_out_aa(X, Y)) → half_out_aa(s(s(X)), s(Y))
U4_ga(X, Y, half_out_aa(X, Y)) → half_out_ga(s(s(X)), s(Y))
U2_agg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_agg(X, I, Y, log2_in_ggg(X1, s(I), Y))
log2_in_ggg(0, I, I) → log2_out_ggg(0, I, I)
log2_in_ggg(s(0), I, I) → log2_out_ggg(s(0), I, I)
log2_in_ggg(s(s(X)), I, Y) → U2_ggg(X, I, Y, half_in_ga(s(s(X)), X1))
U2_ggg(X, I, Y, half_out_ga(s(s(X)), X1)) → U3_ggg(X, I, Y, log2_in_ggg(X1, s(I), Y))
U3_ggg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_ggg(s(s(X)), I, Y)
U3_agg(X, I, Y, log2_out_ggg(X1, s(I), Y)) → log2_out_agg(s(s(X)), I, Y)
U1_ag(X, Y, log2_out_agg(X, 0, Y)) → log2_out_ag(X, Y)

The argument filtering Pi contains the following mapping:
log2_in_ag(x1, x2)  =  log2_in_ag(x2)
U1_ag(x1, x2, x3)  =  U1_ag(x2, x3)
log2_in_agg(x1, x2, x3)  =  log2_in_agg(x2, x3)
log2_out_agg(x1, x2, x3)  =  log2_out_agg(x1, x2, x3)
U2_agg(x1, x2, x3, x4)  =  U2_agg(x2, x3, x4)
half_in_ga(x1, x2)  =  half_in_ga(x1)
s(x1)  =  s
0  =  0
half_out_ga(x1, x2)  =  half_out_ga(x1, x2)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
half_in_aa(x1, x2)  =  half_in_aa
half_out_aa(x1, x2)  =  half_out_aa(x1, x2)
U4_aa(x1, x2, x3)  =  U4_aa(x3)
U3_agg(x1, x2, x3, x4)  =  U3_agg(x2, x3, x4)
log2_in_ggg(x1, x2, x3)  =  log2_in_ggg(x1, x2, x3)
log2_out_ggg(x1, x2, x3)  =  log2_out_ggg(x1, x2, x3)
U2_ggg(x1, x2, x3, x4)  =  U2_ggg(x2, x3, x4)
U3_ggg(x1, x2, x3, x4)  =  U3_ggg(x2, x3, x4)
log2_out_ag(x1, x2)  =  log2_out_ag(x1, x2)
LOG2_IN_GGG(x1, x2, x3)  =  LOG2_IN_GGG(x1, x2, x3)
U2_GGG(x1, x2, x3, x4)  =  U2_GGG(x2, x3, x4)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

LOG2_IN_GGG(s(s(X)), I, Y) → U2_GGG(X, I, Y, half_in_ga(s(s(X)), X1))
U2_GGG(X, I, Y, half_out_ga(s(s(X)), X1)) → LOG2_IN_GGG(X1, s(I), Y)

The TRS R consists of the following rules:

half_in_ga(s(s(X)), s(Y)) → U4_ga(X, Y, half_in_aa(X, Y))
U4_ga(X, Y, half_out_aa(X, Y)) → half_out_ga(s(s(X)), s(Y))
half_in_aa(0, 0) → half_out_aa(0, 0)
half_in_aa(s(0), 0) → half_out_aa(s(0), 0)
half_in_aa(s(s(X)), s(Y)) → U4_aa(X, Y, half_in_aa(X, Y))
U4_aa(X, Y, half_out_aa(X, Y)) → half_out_aa(s(s(X)), s(Y))

The argument filtering Pi contains the following mapping:
half_in_ga(x1, x2)  =  half_in_ga(x1)
s(x1)  =  s
0  =  0
half_out_ga(x1, x2)  =  half_out_ga(x1, x2)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
half_in_aa(x1, x2)  =  half_in_aa
half_out_aa(x1, x2)  =  half_out_aa(x1, x2)
U4_aa(x1, x2, x3)  =  U4_aa(x3)
LOG2_IN_GGG(x1, x2, x3)  =  LOG2_IN_GGG(x1, x2, x3)
U2_GGG(x1, x2, x3, x4)  =  U2_GGG(x2, x3, x4)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ Instantiation

Q DP problem:
The TRS P consists of the following rules:

U2_GGG(I, Y, half_out_ga(s, X1)) → LOG2_IN_GGG(X1, s, Y)
LOG2_IN_GGG(s, I, Y) → U2_GGG(I, Y, half_in_ga(s))

The TRS R consists of the following rules:

half_in_ga(s) → U4_ga(half_in_aa)
U4_ga(half_out_aa(X, Y)) → half_out_ga(s, s)
half_in_aahalf_out_aa(0, 0)
half_in_aahalf_out_aa(s, 0)
half_in_aaU4_aa(half_in_aa)
U4_aa(half_out_aa(X, Y)) → half_out_aa(s, s)

The set Q consists of the following terms:

half_in_ga(x0)
U4_ga(x0)
half_in_aa
U4_aa(x0)

We have to consider all (P,Q,R)-chains.
By instantiating [15] the rule LOG2_IN_GGG(s, I, Y) → U2_GGG(I, Y, half_in_ga(s)) we obtained the following new rules:

LOG2_IN_GGG(s, s, z1) → U2_GGG(s, z1, half_in_ga(s))



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
QDP
                            ↳ Instantiation

Q DP problem:
The TRS P consists of the following rules:

U2_GGG(I, Y, half_out_ga(s, X1)) → LOG2_IN_GGG(X1, s, Y)
LOG2_IN_GGG(s, s, z1) → U2_GGG(s, z1, half_in_ga(s))

The TRS R consists of the following rules:

half_in_ga(s) → U4_ga(half_in_aa)
U4_ga(half_out_aa(X, Y)) → half_out_ga(s, s)
half_in_aahalf_out_aa(0, 0)
half_in_aahalf_out_aa(s, 0)
half_in_aaU4_aa(half_in_aa)
U4_aa(half_out_aa(X, Y)) → half_out_aa(s, s)

The set Q consists of the following terms:

half_in_ga(x0)
U4_ga(x0)
half_in_aa
U4_aa(x0)

We have to consider all (P,Q,R)-chains.
By instantiating [15] the rule U2_GGG(I, Y, half_out_ga(s, X1)) → LOG2_IN_GGG(X1, s, Y) we obtained the following new rules:

U2_GGG(s, z0, half_out_ga(s, x2)) → LOG2_IN_GGG(x2, s, z0)



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
                          ↳ QDP
                            ↳ Instantiation
QDP
                                ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

U2_GGG(s, z0, half_out_ga(s, x2)) → LOG2_IN_GGG(x2, s, z0)
LOG2_IN_GGG(s, s, z1) → U2_GGG(s, z1, half_in_ga(s))

The TRS R consists of the following rules:

half_in_ga(s) → U4_ga(half_in_aa)
U4_ga(half_out_aa(X, Y)) → half_out_ga(s, s)
half_in_aahalf_out_aa(0, 0)
half_in_aahalf_out_aa(s, 0)
half_in_aaU4_aa(half_in_aa)
U4_aa(half_out_aa(X, Y)) → half_out_aa(s, s)

The set Q consists of the following terms:

half_in_ga(x0)
U4_ga(x0)
half_in_aa
U4_aa(x0)

We have to consider all (P,Q,R)-chains.
By narrowing [15] the rule LOG2_IN_GGG(s, s, z1) → U2_GGG(s, z1, half_in_ga(s)) at position [2] we obtained the following new rules:

LOG2_IN_GGG(s, s, y0) → U2_GGG(s, y0, U4_ga(half_in_aa))



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
                          ↳ QDP
                            ↳ Instantiation
                              ↳ QDP
                                ↳ Narrowing
QDP
                                    ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

U2_GGG(s, z0, half_out_ga(s, x2)) → LOG2_IN_GGG(x2, s, z0)
LOG2_IN_GGG(s, s, y0) → U2_GGG(s, y0, U4_ga(half_in_aa))

The TRS R consists of the following rules:

half_in_ga(s) → U4_ga(half_in_aa)
U4_ga(half_out_aa(X, Y)) → half_out_ga(s, s)
half_in_aahalf_out_aa(0, 0)
half_in_aahalf_out_aa(s, 0)
half_in_aaU4_aa(half_in_aa)
U4_aa(half_out_aa(X, Y)) → half_out_aa(s, s)

The set Q consists of the following terms:

half_in_ga(x0)
U4_ga(x0)
half_in_aa
U4_aa(x0)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
                          ↳ QDP
                            ↳ Instantiation
                              ↳ QDP
                                ↳ Narrowing
                                  ↳ QDP
                                    ↳ UsableRulesProof
QDP
                                        ↳ QReductionProof

Q DP problem:
The TRS P consists of the following rules:

U2_GGG(s, z0, half_out_ga(s, x2)) → LOG2_IN_GGG(x2, s, z0)
LOG2_IN_GGG(s, s, y0) → U2_GGG(s, y0, U4_ga(half_in_aa))

The TRS R consists of the following rules:

half_in_aahalf_out_aa(0, 0)
half_in_aahalf_out_aa(s, 0)
half_in_aaU4_aa(half_in_aa)
U4_ga(half_out_aa(X, Y)) → half_out_ga(s, s)
U4_aa(half_out_aa(X, Y)) → half_out_aa(s, s)

The set Q consists of the following terms:

half_in_ga(x0)
U4_ga(x0)
half_in_aa
U4_aa(x0)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

half_in_ga(x0)



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
                          ↳ QDP
                            ↳ Instantiation
                              ↳ QDP
                                ↳ Narrowing
                                  ↳ QDP
                                    ↳ UsableRulesProof
                                      ↳ QDP
                                        ↳ QReductionProof
QDP
                                            ↳ ForwardInstantiation

Q DP problem:
The TRS P consists of the following rules:

U2_GGG(s, z0, half_out_ga(s, x2)) → LOG2_IN_GGG(x2, s, z0)
LOG2_IN_GGG(s, s, y0) → U2_GGG(s, y0, U4_ga(half_in_aa))

The TRS R consists of the following rules:

half_in_aahalf_out_aa(0, 0)
half_in_aahalf_out_aa(s, 0)
half_in_aaU4_aa(half_in_aa)
U4_ga(half_out_aa(X, Y)) → half_out_ga(s, s)
U4_aa(half_out_aa(X, Y)) → half_out_aa(s, s)

The set Q consists of the following terms:

U4_ga(x0)
half_in_aa
U4_aa(x0)

We have to consider all (P,Q,R)-chains.
By forward instantiating [14] the rule U2_GGG(s, z0, half_out_ga(s, x2)) → LOG2_IN_GGG(x2, s, z0) we obtained the following new rules:

U2_GGG(s, x0, half_out_ga(s, s)) → LOG2_IN_GGG(s, s, x0)



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ Instantiation
                          ↳ QDP
                            ↳ Instantiation
                              ↳ QDP
                                ↳ Narrowing
                                  ↳ QDP
                                    ↳ UsableRulesProof
                                      ↳ QDP
                                        ↳ QReductionProof
                                          ↳ QDP
                                            ↳ ForwardInstantiation
QDP
                                                ↳ NonTerminationProof

Q DP problem:
The TRS P consists of the following rules:

U2_GGG(s, x0, half_out_ga(s, s)) → LOG2_IN_GGG(s, s, x0)
LOG2_IN_GGG(s, s, y0) → U2_GGG(s, y0, U4_ga(half_in_aa))

The TRS R consists of the following rules:

half_in_aahalf_out_aa(0, 0)
half_in_aahalf_out_aa(s, 0)
half_in_aaU4_aa(half_in_aa)
U4_ga(half_out_aa(X, Y)) → half_out_ga(s, s)
U4_aa(half_out_aa(X, Y)) → half_out_aa(s, s)

The set Q consists of the following terms:

U4_ga(x0)
half_in_aa
U4_aa(x0)

We have to consider all (P,Q,R)-chains.
We used the non-termination processor [17] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

The TRS P consists of the following rules:

U2_GGG(s, x0, half_out_ga(s, s)) → LOG2_IN_GGG(s, s, x0)
LOG2_IN_GGG(s, s, y0) → U2_GGG(s, y0, U4_ga(half_in_aa))

The TRS R consists of the following rules:

half_in_aahalf_out_aa(0, 0)
half_in_aahalf_out_aa(s, 0)
half_in_aaU4_aa(half_in_aa)
U4_ga(half_out_aa(X, Y)) → half_out_ga(s, s)
U4_aa(half_out_aa(X, Y)) → half_out_aa(s, s)


s = U2_GGG(s, x0, U4_ga(half_in_aa)) evaluates to t =U2_GGG(s, x0, U4_ga(half_in_aa))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:




Rewriting sequence

U2_GGG(s, x0, U4_ga(half_in_aa))U2_GGG(s, x0, U4_ga(half_out_aa(0, 0)))
with rule half_in_aahalf_out_aa(0, 0) at position [2,0] and matcher [ ]

U2_GGG(s, x0, U4_ga(half_out_aa(0, 0)))U2_GGG(s, x0, half_out_ga(s, s))
with rule U4_ga(half_out_aa(X, Y)) → half_out_ga(s, s) at position [2] and matcher [X / 0, Y / 0]

U2_GGG(s, x0, half_out_ga(s, s))LOG2_IN_GGG(s, s, x0)
with rule U2_GGG(s, x0', half_out_ga(s, s)) → LOG2_IN_GGG(s, s, x0') at position [] and matcher [x0' / x0]

LOG2_IN_GGG(s, s, x0)U2_GGG(s, x0, U4_ga(half_in_aa))
with rule LOG2_IN_GGG(s, s, y0) → U2_GGG(s, y0, U4_ga(half_in_aa))

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.